package game.assist.diablo3.data.dao.impl;

import game.assist.diablo3.data.dao.GoodCategoryDAO;
import game.assist.diablo3.data.vo.GoodsCategory;
import game.assist.diablo3.db.DiabloDatabaseHelper;

import java.sql.SQLException;
import java.util.ArrayList;

import com.j256.ormlite.android.apptools.OrmLiteBaseActivity;
import com.j256.ormlite.dao.Dao;

public class GoodCategoryDAOImpl implements GoodCategoryDAO {

	private OrmLiteBaseActivity<DiabloDatabaseHelper> ormLiteBaseActivity;

	public GoodCategoryDAOImpl(OrmLiteBaseActivity<DiabloDatabaseHelper> ormLiteBaseActivity) {
		super();
		this.ormLiteBaseActivity = ormLiteBaseActivity;
	}

	@Override
	public ArrayList<GoodsCategory> queryAllGoodCategory() throws SQLException {
		Dao<GoodsCategory, Integer> goodCategoryDao = ormLiteBaseActivity.getHelper().getGoodCategoryDao();
		ArrayList<GoodsCategory> categoryList = (ArrayList<GoodsCategory>) goodCategoryDao.queryForAll();
		return categoryList;
	}

//	@Override
//	public void parseAllGoodsCategory(ArrayList<GoodsCategory> goodsCategories) throws SQLException {
//		if (goodsCategories == null) {
//			goodsCategories = queryAllGoodCategory();
//		}
//		
//		
//		
//	}

}
